package com.huanwei.cc.activity;

import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.huanwei.cc.R;
import com.huanwei.cc.base.BaseActivity;
import com.huanwei.cc.bean.FeedbbackBean;
import com.huanwei.cc.utils.JSONUtils;
import com.huanwei.cc.utils.Okhttp;
import com.huanwei.http.API;


/**
 * 我的反馈
 */
public class Me_feedback_activity extends BaseActivity implements View.OnClickListener {
    private ImageView me_feedback_path;
    private TextView me_feedback_butten;
    private EditText me_feedback;
    private String mS;

    @Override
    public int setLayoutId() {
        return R.layout.me_feedback;
    }

    @Override
    public void initViewsAndEvents() {
        findid();

    }

    String id;

    private void findid() {
        id = getIntent().getStringExtra("id");
        me_feedback_path = (ImageView) findViewById(R.id.me_feedback_path);
        me_feedback_path.setOnClickListener(this);
        me_feedback_butten = (TextView) findViewById(R.id.me_feedback_butten);
        me_feedback_butten.setOnClickListener(this);
        me_feedback = (EditText) findViewById(R.id.me_feedback);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.me_feedback_path:
                finish();
                break;
            case R.id.me_feedback_butten:
                mS = me_feedback.getText().toString();
                API.DiJiaoFanKui(id, mS, new com.huanwei.http.Okhttp.Objectcallback() {
                    @Override
                    public void onsuccess(String st) {
                        Log.e("111", "xx" + st);
                        Toast.makeText(Me_feedback_activity.this, "递交成功", Toast.LENGTH_SHORT).show();
                        finish();

                    }

                    @Override
                    public void onFalia(int code, String errst) {
                        Log.e("111", "xx" + errst);
                        Toast.makeText(Me_feedback_activity.this, "网络错误", Toast.LENGTH_SHORT).show();
                    }
                });

                break;

        }

    }

}
